# https://github.com/piskvorky/gensim-data

import gensim.downloader as api
import time


class GloveModel:
    def __init__(self, model):
        print(
            "--- This application might need to download and initialize pre-trained models if not exists, which takes time... ---"
        )
        start_time = time.time()
        self.model = api.load(model)  # glove-wiki-gigaword-50  glove-twitter-25
        print(
            "--- Gensim model takes %s seconds to initialize ---"
            % (time.time() - start_time)
        )

    def key(self, key: str) -> list:
        return self.model[key]


if __name__ == "__main__":
    model = GloveModel()
    print(model.key("cat"))
